package com.fantastic.common.exception.enums;

/**
 * @author: rxx
 * @since: 2024/5/23 15:51
 * @description: 响应状态枚举类
 */
public enum RespStatusInfo {
    // 通用状态码
    OK(200, "成功"),
    SERVER_ERROR(500, "服务器出错了捏"),
    PARAMETER_ERROR(400, "参数错误"),
    NOT_FOUND(404, "资源未找到"),
    LOGIN(403, "请登录"),
    JWT_SECURITY(4001, "无效的签名"),
    JWT_MALFORMED(4002, "无效的Token"),
    JWT_EXPIRED(4003, "Token已过期"),
    JWT_UNSUPPORTED(4004, "不支持的Token"),

    //sql状态
    SELECT_ERROR(1101, "查询异常"),
    UPDATE_ERROR(1101, "修改异常"),
    INSERT_ERROR(1102, "添加异常"),
    DELETE_ERROR(1103, "删除异常"),

    //业务状态码
    SELECT_NULL(1301, "未找到数据"),
    LOGIN_ERROR(1302, "登录失败！账号或密码或手机号不正确！"),
    LOGIN_ISNULL(1303, "登录失败！账号或密码或手机号不完整！"),
    REGIS_ERROR(1304, "注册信息不完整！"),
    ACCOUNT_ERROR(1305, "账号封禁！"),
    EXCHANGE_ERROR(1306, "兑换异常！"),
    INTEGRAL_NO_SATISFY(1307, "积分不足！"),
    PHONE_NULL(1307, "手机号不合法！"),
    PHONE_ISNULL(1308, "手机号不存在！"),
    CODE_ERROR(1321, "验证码不正确！"),
    CODE_TIMEOUT(1322, "验证码过期！"),

    ALIPAY_RES_FAIL(1323, "支付调用失败！"),
    ALIPAY_OK(1324, "支付成功！"),
    ALIPAY_FAIL(1325, "支付失败！"),
    ALIPAY_ERROR(1326, "支付异常！"),
    ALIPAY_SECURITY_ERROR(1327, "支付验签异常！"),
    ALIPAY_VOID_SECURITY(1328, "无效签名！"),
    WAIT_BUYER_PAY(1329, "等待付款"),
    TRADE_SUCCESS(1330, "支付成功，可退款"),
    TRADE_FINISHED(1331, "交易结束，不可退款"),
    TRADE_CLOSED(1332, "未付款交易超时关闭，或支付完成后全额退款"),
    ALIPAY_REQ_ERROR(1333, "支付发起失败！"),
    MONEY_NOT(1334, "余额不足"),
    CART_NOT(1335, "购物车为空！！！"),

    OK_LOGIN(201, "登录成功"),
    OK_REGIS(202, "注册成功"),

    REGIS_SERVER_ERROR(1501, "注册失败！服务器错误！"),

    MAX_UPLOAD_SIZE_ERROR(1502, "文件超出限制大小！"),
    DATA_ERROR(1503, "数据不符合约束！"),
    FILETYPE_ERROR(1504, "文件类型不支持！"),
    FILETYPE_NULL(1505, "文件为NULL！"),
    ;
    private final int code;
    private final String message;

    // 可以继续添加其他业务相关的错误码
    RespStatusInfo(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


}
